package com.ftg.learn.smhtml.qianduan.contorller;


import com.ftg.learn.smhtml.qianduan.pojo.Chanpin;
import com.ftg.learn.smhtml.qianduan.service.ChanpinService;
import com.ftg.learn.smhtml.qianduan.service.GuanyuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/chanpin")
public class ChanpinContorller {

    @Autowired
    ChanpinService cs;

    @GetMapping("/showchanpin")
    public List<Chanpin> showall(){
        return cs.showAll();

    }
}
